package com.bw.shop2208a.adapter

import android.widget.CheckBox
import android.widget.ImageView
import com.bw.shop2208a.R
import com.bw.shop2208a.entity.DataGetCarEntity
import com.bw.shop2208a.utils.GlideUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class CarAdapter : BaseQuickAdapter<DataGetCarEntity,BaseViewHolder>(R.layout.item_car) {
    override fun convert(holder: BaseViewHolder, item: DataGetCarEntity) {
        holder.setText(R.id.tv,item.goods_desc)
        val imageView = holder.getView<ImageView>(R.id.iv)
        GlideUtils.loadConnerImage(context,imageView,item.goods_default_icon,25)
        holder.setText(R.id.price,"￥:"+item.goods_default_price+"元")
        holder.setText(R.id.count,item.count.toString())

        val checkBox = holder.getView<CheckBox>(R.id.cb)
        checkBox.isChecked = item.isChecked
    }
}